Contents
DBSearch

Version 0.971

TDBSearch is a class to enable Paradox like searching on any field in a TDataSource.  It seems to be reasonably fast.  I have only tested it on a maximum of 5000 records, but the speed results were good.  It curently DOES NOT support the use of indexes.  This version is FREEWARE.  By using this software you agree not to hold me responsible for any problems or damage that may result from using the software.

The password for the source is FREE and available if you send me an email either explaining how you might use DBSearch, or any suggestions as to how to improve it.

If you have any questions or comments please send them to me (Aaron Castro) at:

Compuserve: 71534,2312

What's new

Supported functions (DBSearch class:

Create

SetDefLocateField

Locate

LocateNext

SetDataSource

GetDataSource

SetHelpFile

Supported functions (SerchEng class:)

CompareStrings

DoLocate

SetDataSource

GetDataSource


CompareStrings

function CompareStrings(Str: string; LocateStr: string; CaseSensitive: boolean; PatternMatch: boolean): boolean;

Protected

Compares 2 strings with or without case sensitivity and pattern matching.

Returns True if matches.


TLocateInfo

Structure used to hold information for search.

TLocateInfo = record

      LocateField: string;	{The field to search}

      LocateText: string;	{The text with pattern to search for}

      CaseSensitive: boolean;	{Is the search case sensitive?}

      ExactMatch: boolean;	{Should we look for an exact match?}

      end;


DoLocate

procedure DoLocate(LocateInfo: TLocateInfo; FromBeginning: Boolean);

Public

Moves the cursor to the record that contains the field matching the criteria in LocateInfo.

See also:

TLocateInfo


Get/SetDataSource

procedure SetDataSource(Value: TDataSource);

function GetDataSource: TDataSource;

Public

Gets or sets the DataSource to be searched.


Create

constructor Create(ADataSource: TDataSource);

Creates a TDBSearch object and attaches it to a DataSource.


SetDefLocateField

procedure SetDefLocateField(LocateFldStr: string)

Sets the default field to search on.  Selects the item from the drop down list of available fields to search.


Locate

procedure Locate;

Displays the locate dialogbox and does the search if the user presses OK.  Upon success, moves the record pointer to the matching record,  if not an EDBSearchPatternNotFound exception is raised.


LocateNext

procedure LocateNext;

Searches for the next occurence of the search pattern.  If locate was not previously called then the locate dialogbox is displayed.  Upon success, moves the record pointer to the matching record,  if not an EDBSearchPatternNotFound exception is raised.


SetDataSource

procedure SetDataSource(DS: TDataSource);

Allows you to switch data sources.  Any previous locate information entered is lost, i.e. Default field and previous search text.


GetDataSource

function GetDataSource: TDataSource;

Returns the DataDource DBSearch is using.


SetHelpFile

procedure SetHelpFile(FileName: String);

Sets the help filename that is called from the Locate dialog box. (Default is DBSRUN.HLP)


What's new

Version 0.971

1)	Searches memo fields upto 255 chars

2)	Updated help file.